<% if @task.present? %>
    <div class="export-options">
      <%= link_to "PDF", current_url(:format => :pdf), :target => "_blank" %>
      <%= link_to "CSV", current_url(:format => :csv), :target => "_blank" %>
      <%= link_to "Excel", current_url(:format => :xls), :target => "_blank" %>
    </div>
    <% if @logs.present? %>
        <table class="table sortable-tables highchart" data-graph-container-before="1" data-graph-type="line" data-graph-xaxis-rotation="-45">
          <thead>
          <tr>
            <th width="200">Date</th>
            <th width="300">Employee</th>
            <th width="200">Hours</th>
            <th width="200" class="hidden_class">Hours</th>
            <th width="400">Description</th>
          </tr>
          </thead>
          <% @logs.each do |log| %>
              <tr>
                <td><%= log.date %></td>
                <td><%= log.user.name %></td>
                <td class="hidden_class"><%= log.hours.to_s.gsub(":","") %></td>
                <td><%= log.hours %></td>
                <td><%= log.description %></td>
              </tr>
          <% end %>
          <tfoot>
          <tr>
            <td><%= "#{@stats['days']} Days" %></td>
            <td><%= "#{@stats['users']} users" %></td>
            <td><%= "#{@stats['time']}" %></td>
            <td></td>
          </tr>
          </tfoot>
        </table>
    <% else %>
        <div class="alert-box secondary">
          No work logs found
        </div>
    <% end %>
    <script type="text/javascript">
        $(".sortable-tables").tablesorter();
        //    if ($('.table tbody tr').length > 1){$('table.highchart').highchartTable();}
    </script>
<% else %>
    <div class="alert-box secondary">
      Task not found
    </div>
<% end %>